package com.yeskery.nut.web.demo.dto;

import com.yeskery.nut.annotation.api.ApiModel;
import com.yeskery.nut.annotation.api.ApiModelProperty;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

/**
 * 下单dto
 * @author Yeskery
 * 2023/7/28
 */
@Data
@ApiModel("下单dto")
public class TakeOrderDto {

    /**
     * 商品id
     */
    @ApiModelProperty("商品id")
    @NotNull(message = "商品id不能为空")
    private Integer productId;

    /**
     * 商品数量
     */
    @ApiModelProperty("商品数量")
    @NotNull(message = "商品数量不能为空")
    @Min(value = 1, message = "商品数量错误")
    @Max(value = 10, message = "超过最大购买限制数量")
    private Integer num;
}
